﻿#include "VerifyDialog.h"

VerifyDialog::VerifyDialog(QWidget *parent)
	: QDialog(parent)
	, ui(new Ui::VerifyDialogClass())
{
	ui->setupUi(this);

}

VerifyDialog::~VerifyDialog()
{
	delete ui;
}

void VerifyDialog::on_pushButton_ok_clicked()
{
	QString inputPassword = ui->lineEdit_inputPassword->text();

	if (inputPassword != CoreData::generatePasswordFromMacAddress() || inputPassword.isEmpty())
	{
		emit sendCheckResult(false);
	}
	else {
		emit sendCheckResult(true);
	}
	this->close();
}

void VerifyDialog::shiftLanguage(bool languageType)
{
	if (languageType)
	{
		ui->label->setText(u8"请输入密钥： ");
		ui->pushButton_ok->setText(u8"确定");
	}
	else
	{
		ui->label->setText("Please enter your key words:");
		ui->pushButton_ok->setText("confirm");
	}
}
